package org.mspring.mlog.action.admin;

import org.mspring.mlog.service.CommentService;
import org.mspring.nbee.web.Action;
import org.mspring.nbee.web.support.WebContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author GaoYoubo
 * @since 2015/2/20
 */
@Action
@RequestMapping("/admin/test")
public class TestAction {
    private CommentService commentService;

    @RequestMapping("/sync-duoshuo")
    public void syncDuoshuo(WebContext context) {
        commentService.syncFromDuoshuo();
        context.renderJsonResult(true);
    }

    @Autowired
    public void setCommentService(CommentService commentService) {
        this.commentService = commentService;
    }
}
